Skip to content

[WONTFIX?] Square a standing player's feet up after 3 s - #2243

Draft
sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:anim-face-front-timer
Draft

sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:anim-face-front-timer

Conversation

@sunzenshen

Copy link
Copy Markdown
Contributor

Description

Case 3: standing players stay twisted.
Review page: exported review page (Dropbox) · live review page (opening it lets you request access with your email or Claude account).

A standing player who looks to the side stays twisted between eyes and feet, up to 90 degrees, until moving or leaning: ComputePoseParam_AimYaw moves the feet of a standing player only when the twist passes 90 degrees, and then by a fixed 90. Classic NEOTOKYO squares the feet up to the eyes once they have not turned for 3 s (mp_facefronttime, the 2006 SDK base's face-front timer), so a player standing still faces where they look.

This PR adds that one rule to the standing branch: when the feet have not turned for mp_facefronttime seconds, their goal is the eye yaw, and they turn there through the existing convergence (720 deg/s, the same as mp_feetyawrate). Nothing new is defined: mp_facefronttime is the 2006 base's cvar, already compiled into neo (base_playeranimstate.cpp) and declared but unused in multiplayer_animstate.cpp; the feet turn time is neo's existing m_flLastAimTurnTime. +10 lines, all in hl2mp_playeranimstate.cpp (an extern and a three-line else if, each under #ifdef NEO, and a comment). The base's own ComputePoseParam_BodyYaw cannot be called here, since CMultiPlayerAnimState does not derive from CBasePlayerAnimState.

Moving, leaning (#1955) and the 90-degree limit keep their branches, which run first. The m_bForceAimYaw ("prone and undeployed") branch is never set in neo and is untouched.

Independent of the other animation PRs from the review page. #2241 (case 1) changes the moving test at the top of the same function to horizontal speed; the two merge without conflict (trial merge of this branch with #2240, #2241 and the sprint-legs PR checked).

How this was compared

The code came first: neo's ComputePoseParam_AimYaw against the 2006 base classic is built on (base_playeranimstate.cpp:808-887), and classic's client.dll read for its version (ComputePoseParam_BodyYaw: the same face-front branch, reading the mp_facefronttime cvar, default 3). Then per-frame animation logs from both games (classic's cl_showanimstate_log, neo's harness log) on the same map (nt_rise_ctg), spot, camera, class and weapon (NSF Assault bot with the MPN, on bot_mimic 1, its eyes turned by bot_mimic_yaw_offset keys), with the same scripted keys, read by the same scripts. Then side-by-side clips. Numbers come from the logs, not from watching.

How to test

  1. Stand still and turn the view 30 degrees: the torso turns at once, and about 3 s later the feet turn to face the same way (about 0.2 s).
  2. Turn 90 degrees or more: the feet follow at once (as before), and the remaining twist is squared up 3 s later.
  3. Lean or move: the feet follow the eyes at once, as before.

Results

Same scripted pass as the review page (the bot's eyes turn 30 degrees at 3 s, 90 more at 9 s, back 120 at 13 s; lean at 16 s). neo: Release builds of master (f426c22) and this PR; twist = body_yaw.

eyes classic master this PR
30 deg twist 23 (after a 7 deg feet nudge), held; feet turn 3.18 s after the turn (in 0.12 s), twist 1 twist 30, held (6 s, until the next turn) twist 30, held; feet turn 2.94 s after the turn (in 0.20 s), twist 1
90 deg more feet follow 0.29 s after the turn (in 0.24 s), twist 1 feet jump 90 in 0.27 s, twist 31, held feet follow at once (in 0.27 s), twist 1
back 120 deg feet follow in 0.23 s, twist 23-25, held until the lean twist 90, held until the lean feet follow in 0.23 s, twist 30, held until the lean

A longer pass on this PR (8 s between turns, one turn while crouched): every twist left standing or crouched was squared up 3.1-3.4 s after the last feet turn, in 0.17-0.28 s, to within 2 degrees.

Bots (10 on ntre_rise_ctg, chase camera cycling through them, 120 s): of the frames where a bot stood still, master showed a twist over 20 degrees in 22%, held up to 5.6 s; this PR 9%, held up to 0.8 s.

Unchanged, checked on the same pass: crouch and stand timing, jumps, fire and reload gestures, upper-body weights while walking, crouch walking and running, leaning (feet follow the eyes at the lean in both builds). A Debug client with 10 bots on ntre_rise_ctg (90 s) logged only the known neo_root.cpp (378) localizedWszStr at startup and one clientleafsystem.cpp (1025) m_ShadowsInLeaf (an intermittent engine shadow assert seen before this change).

Hitboxes: the server runs the same anim state and sets the player's angles to the feet yaw, so after 3 s a standing player's server-side body faces where they look, as in classic, instead of keeping the twist. Hitbox positions were not measured.

Not changed: the 90-degree limit and its fixed 90-degree step while the timer runs (classic's limit and step differ slightly: it follows to a 25-degree twist where neo leaves 30).

GIF (classic / master / this PR): case3-face-front.gif

A standing player who turned to the side stayed twisted between eyes
and feet, up to 90 degrees, until moving or leaning. Classic NEOTOKYO
and the 2006 SDK base turn the feet to the eyes once they have not
turned for mp_facefronttime (3 s). Use the same rule with the base's
existing cvar and neo's existing feet turn time.
@sunzenshen sunzenshen added the Animations Animation stuff. Including the syncronizing of animations between client and server based on state. label Oct 15, 2026
@sunzenshen

Copy link
Copy Markdown
Contributor Author
case3-face-front

@sunzenshen

Copy link
Copy Markdown
Contributor Author

#2244 might actually accomplish the same and better than this, so waiting of the result of that review before deciding what to do with this PR.

(This PR edits hl2mp_playeranimstate.*, which #2244 no longer uses and could even remove from the build.)

@sunzenshen sunzenshen changed the title Square a standing player's feet up after 3 s [WONTFIX?] Square a standing player's feet up after 3 s Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Animations Animation stuff. Including the syncronizing of animations between client and server based on state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant